package com.ruoyi.loginAndregist.service.impl;

import java.util.List;

import com.ruoyi.loginAndregist.domain.WxUser2;
import com.ruoyi.loginAndregist.mapper.WxUser2Mapper;
import com.ruoyi.loginAndregist.service.IWxUserService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.core.text.Convert;

/**
 * wx用户Service业务层处理
 * 
 * @author wq
 * @date 2020-11-10
 */
@Service
public class WxUserService2Impl implements IWxUserService2
{
    @Autowired
    private WxUser2Mapper wxUser2Mapper;

    /**
     * 查询wx用户
     * 
     * @param id wx用户ID
     * @return wx用户
     */
    @Override
    public WxUser2 selectWxUserById(Long id)
    {
        return wxUser2Mapper.selectWxUserById(id);
    }

    @Override
    public WxUser2 selectWxUserByOpenId(String openid) {
        return wxUser2Mapper.selectWxUserByOpenId(openid);
    }

    /**
     * 查询wx用户列表
     * 
     * @param wxUser2 wx用户
     * @return wx用户
     */
    @Override
    public List<WxUser2> selectWxUserList(WxUser2 wxUser2)
    {
        return wxUser2Mapper.selectWxUserList(wxUser2);
    }

    /**
     * 新增wx用户
     * 
     * @param wxUser2 wx用户
     * @return 结果
     */
    @Override
    public int insertWxUser(WxUser2 wxUser2)
    {
        return wxUser2Mapper.insertWxUser(wxUser2);
    }

    /**
     * 修改wx用户
     * 
     * @param wxUser2 wx用户
     * @return 结果
     */
    @Override
    public int updateWxUser(WxUser2 wxUser2)
    {
        return wxUser2Mapper.updateWxUser(wxUser2);
    }

    public int updateWxUserByOpenId(WxUser2 wxUser2)
    {
        return wxUser2Mapper.updateWxUserByOpenId(wxUser2);
    }

    /**
     * 删除wx用户对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWxUserByIds(String ids)
    {
        return wxUser2Mapper.deleteWxUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除wx用户信息
     * 
     * @param id wx用户ID
     * @return 结果
     */
    @Override
    public int deleteWxUserById(Long id)
    {
        return wxUser2Mapper.deleteWxUserById(id);
    }

    @Override
    public WxUser2 selectWxUser(WxUser2 wxUser2) {
        return wxUser2Mapper.selectWxUser(wxUser2);
    }

    @Override
    public WxUser2 getWxUser(WxUser2 wxUser2) {
        return wxUser2Mapper.getWxUser(wxUser2);
    }
}
